package cn.lh.service.impl;

import cn.lh.domain.Employee;
import cn.lh.enums.GlobalErrorCode;
import cn.lh.exception.GlobalCustomException;
import cn.lh.mapper.EmployeeMapper;
import cn.lh.service.IEmployeeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 服务实现类
 *
 * @author lvHao
 * @since 2022-08-25
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {
    @Override
    public boolean insert(Employee entity) {
        if (entity.getTel() == null) {
            throw new GlobalCustomException(GlobalErrorCode.SERVICE_PARAM_IS_NULL);
        }
        return super.insert(entity);
    }
}
